/**
* @file queue_processor_mdc.h
*
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2021. All rights reserved.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef QUEUE_PROCESS_MDC_H
#define QUEUE_PROCESS_MDC_H

#include <map>
#include <string>
#include "queue_process.h"

namespace acl {
class QueueProcessorMdc : public QueueProcessor
{
public:
    virtual aclError acltdtCreateQueue(const acltdtQueueAttr *const attr, uint32_t *const qid) override;

    virtual aclError acltdtDestroyQueue(const uint32_t qid) override;

    virtual aclError acltdtEnqueue(const uint32_t qid, const acltdtBuf buf, const int32_t timeout) override;

    virtual aclError acltdtDequeue(const uint32_t qid, acltdtBuf *const buf, const int32_t timeout) override;

    virtual aclError acltdtGrantQueue(const uint32_t qid, const int32_t pid, const uint32_t permission,
        const int32_t timeout) override;

    virtual aclError acltdtAttachQueue(const uint32_t qid, const int32_t timeout,
        uint32_t *const permission) override;

    virtual aclError acltdtBindQueueRoutes(acltdtQueueRouteList *const qRouteList) override;

    virtual aclError acltdtUnbindQueueRoutes(acltdtQueueRouteList *const qRouteList) override;

    aclError GrantQueue2Cp(const int32_t deviceId, const uint32_t qid) const;

    virtual aclError acltdtQueryQueueRoutes(const acltdtQueueRouteQueryInfo *const queryInfo,
                                    acltdtQueueRouteList *const qRouteList) override;

    virtual aclError acltdtAllocBuf(const size_t size, acltdtBuf *const buf) const override;

    virtual aclError acltdtFreeBuf(acltdtBuf buf) const override;

    virtual aclError acltdtGetBufData(const acltdtBuf buf, void **const dataPtr, size_t *const size) override;

    QueueProcessorMdc() = default;
    virtual ~QueueProcessorMdc() = default;

    // not allow copy constructor and assignment operators
    QueueProcessorMdc(const QueueProcessorMdc &) = delete;

    QueueProcessorMdc &operator=(const QueueProcessorMdc &) = delete;

    QueueProcessorMdc(QueueProcessorMdc &&) = delete;

    QueueProcessorMdc &&operator=(QueueProcessorMdc &&) = delete;

protected:
    static bool isMbufInit;
};
}



#endif // QUEUE_PROCESS_MDC_H